package com.yunxi.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by 枫下 on 2018/3/21.
 */
public class S2SEnums {

    public static enum OperatorType {
        insert("I", "新增"), update("U", "更新"),delete("D", "删除"),none("N", "公告"),blocking("B", "冻结");
        private String key;
        private String value;
        private OperatorType(String key, String value) {
            this.key = key;
            this.value = value;
        }
        public String getKey() {
            return this.key;
        }
        public void setKey(String value) {
            this.key = key;
        }
        public String getValue() {
            return value;
        }
        public void setValue(String value) {
            this.value = value;
        }
        public static String getValue(String key) {
            for (OperatorType sourceType : OperatorType.values()) {
                if (sourceType.getKey().equals(key)) {
                    return sourceType.getValue();
                }
            }
            return null;
        }
        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (OperatorType sourceType : OperatorType.values()) {
                Map map = new HashMap();
                map.put("key", sourceType.getKey());
                map.put("value", sourceType.getValue());
                list.add(map);
            }
            return list;
        }
    }
    public static enum PartnerStatus {
        ENTRY(1, "入网"), CANCEL(2, "退网"),SCAN(3, "冻结");
        private Integer key;
        private String value;
        private PartnerStatus(Integer key, String desc) {
            this.key = key;
            this.value = value;
        }
        public Integer getKey() {
            return this.key;
        }
        public void setKey(Integer key) {
            this.key = key;
        }
        public String getValue() {
            return value;
        }
        public void setValue(String desc) {
            this.value = value;
        }
        public static String getValue(Integer value) {
            for (PartnerStatus oilSource : PartnerStatus.values()) {
                if (oilSource.getKey().intValue() == value.intValue()) {
                    return oilSource.getValue();
                }
            }
            return null;
        }
        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (PartnerStatus oilSource : PartnerStatus.values()) {
                Map map = new HashMap();
                map.put("key", oilSource.getKey());
                map.put("value", oilSource.getValue());
                list.add(map);
            }
            return list;
        }
    }
    public static enum StatusType {
        a(10011001, "有效"), b(10011002, "无效");
        private Integer value;
        private String desc;
        private StatusType(Integer value, String desc) {
            this.value = value;
            this.desc = desc;
        }
        public Integer getValue() {
            return this.value;
        }
        public void setValue(Integer value) {
            this.value = value;
        }
        public String getDesc() {
            return desc;
        }
        public void setDesc(String desc) {
            this.desc = desc;
        }
        public static String getDesc(Integer value) {
            for (StatusType statusType : StatusType.values()) {
                if (statusType.getValue().intValue() == value.intValue()) {
                    return statusType.getDesc();
                }
            }
            return null;
        }
        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (StatusType statusType : StatusType.values()) {
                Map map = new HashMap();
                map.put("key", statusType.getValue());
                map.put("value", statusType.getDesc());
                list.add(map);
            }
            return list;
        }
    }

    public static enum TenantType {
        a(1, "企业"), b(2, "司机");
        private Integer value;
        private String desc;
        private TenantType(Integer value, String desc) {
            this.value = value;
            this.desc = desc;
        }
        public Integer getValue() {
            return this.value;
        }
        public void setValue(Integer value) {
            this.value = value;
        }
        public String getDesc() {
            return desc;
        }
        public void setDesc(String desc) {
            this.desc = desc;
        }
        public static String getDesc(Integer value) {
            for (TenantType tenantType : TenantType.values()) {
                if (tenantType.getValue().intValue() == value.intValue()) {
                    return tenantType.getDesc();
                }
            }
            return null;
        }
        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (TenantType tenantType : TenantType.values()) {
                Map map = new HashMap();
                map.put("key", tenantType.getValue());
                map.put("value", tenantType.getDesc());
                list.add(map);
            }
            return list;
        }
    }

    public static enum WorkStatusType {
        a(10011001, "在职"), b(10011002, "离职"),c(10011003, "自离");
        private Integer value;
        private String desc;

        private WorkStatusType(Integer value, String desc) {
            this.value = value;
            this.desc = desc;
        }

        public Integer getValue() {
            return this.value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDesc(Integer value) {
            for (WorkStatusType workStatusType : WorkStatusType.values()) {
                if (workStatusType.getValue().intValue() == value.intValue()) {
                    return workStatusType.getDesc();
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (WorkStatusType workStatusType : WorkStatusType.values()) {
                Map map = new HashMap();
                map.put("key", workStatusType.getValue());
                map.put("value", workStatusType.getDesc());
                list.add(map);
            }
            return list;
        }
    }

    public static enum DistStatusType {
        a(0,"未分配"),b(1,"已分配");
        private int key;
        private String value;

        private DistStatusType(int key, String value) {
            this.key = key;
            this.value = value;
        }

        public static String getTypeName(int key) {
            for(DistStatusType distStatusType : DistStatusType.values()){
                if(distStatusType.getKey() == key){
                    return distStatusType.value;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for(DistStatusType carStatusType : DistStatusType.values()){
                Map map = new HashMap();
                map.put("key",carStatusType.getKey());
                map.put("value",carStatusType.getValue());
                list.add(map);
            }
            return list;
        }

        public int getKey() {
            return key;
        }

        public void setKey(int key) {
            this.key = key;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }

    public static enum CarType {

        a(40021001,"砼车"),b(40021002,"泵车"),c(40021003,"行政车");

        private Integer key;
        private String value;
        private CarType(Integer key, String value){
            this.key = key;
            this.value = value;
        }

        public static String getTypeName(int key) {
            for(CarType carType : CarType.values()){
                if(carType.getKey() == key){
                    return carType.value;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for(CarType carStatusType : CarType.values()){
                Map map = new HashMap();
                map.put("key",carStatusType.getKey());
                map.put("value",carStatusType.getValue());
                list.add(map);
            }
            return list;
        }

        public Integer getKey() {
            return key;
        }

        public void setKey(int key) {
            this.key = key;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }

    public static enum CarStatus {
        a(10011001,"可用"),b(10011002,"不可用");
        private int key;
        private String value;
        private CarStatus(int key, String value) {
            this.key = key;
            this.value = value;
        }
        public static String getTypeName(int key) {
            for(CarStatus carStatus : CarStatus.values()){
                if(carStatus.getKey() == key){
                    return carStatus.value;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for(CarStatus carStatus : CarStatus.values()){
                Map map = new HashMap();
                map.put("key",carStatus.getKey());
                map.put("value",carStatus.getValue());
                list.add(map);
            }
            return list;
        }

        public int getKey() {
            return key;
        }

        public void setKey(int key) {
            this.key = key;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }

    public static enum AccountType {
        WAIT(40061001l,"未结算"),FINISH(40061002l,"已结算"),CANCEL(40061003l,"取消结算");

        private Long value;
        private String desc;

        private AccountType(Long value, String desc){
            this.value = value;
            this.desc = desc;
        }

        public Long getValue() {
            return this.value;
        }

        public void setValue(Long value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDesc(Long value) {
            for(AccountType userType : AccountType.values()){
                if(userType.getValue().longValue() == value.longValue()){
                    return userType.getDesc() ;
                }
            }
            return null;
        }
    }

    public static List getList() {
        List<Map> list = new ArrayList<Map>();
        for(AccountType carStatusType : AccountType.values()){
            Map map = new HashMap();
            map.put("key",carStatusType.getValue());
            map.put("value",carStatusType.getDesc());
            list.add(map);
        }
        return list;
    }

    public static enum BillTempStatus {
        WAIT(0,"未结算"),FINISH(1,"已处理"),EXP(2,"异常"),OTHER(3,"其他");
        private String typeName;
        private int status;
        private BillTempStatus( int status,String typeName){
            this.typeName = typeName;
            this.status = status;
        }

        public String getTypeName() {
            return typeName;
        }

        public void setTypeName(String typeName) {
            this.typeName = typeName;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public static String getTypeName(int status) {
            for(BillTempStatus yesOrNo : BillTempStatus.values()){
                if(yesOrNo.getStatus() == status){
                    return yesOrNo.typeName ;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for(BillTempStatus carStatusType : BillTempStatus.values()){
                Map map = new HashMap();
                map.put("key",carStatusType.getStatus());
                map.put("value",carStatusType.getTypeName());
                list.add(map);
            }
            return list;
        }
    }

    public static enum OrderStatus {
        WAITCOMMIT("草稿", 0), NETPOINTCANCEL("作废", 1),/*WAITAUDIT("待审核",2),*/COMMITDMS("已提交", 3)/*,HQCANCEL("总部取消",4)*/;

        private String typeName;
        private int code;

        private OrderStatus(String typeName, int code) {
            this.typeName = typeName;
            this.code = code;
        }

        public String getTypeName() {
            return typeName;
        }

        public void setTypeName(String typeName) {
            this.typeName = typeName;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public static String getTypeName(int code) {
            for (OrderStatus type : OrderStatus.values()) {
                if (type.getCode() == code) {
                    return type.typeName;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (OrderStatus carStatusType : OrderStatus.values()) {
                Map map = new HashMap();
                map.put("key", carStatusType.getCode());
                map.put("value", carStatusType.getTypeName());
                list.add(map);
            }
            return list;
        }
    }

    public static enum PositionType {
        YES("是",10011001),NO_CENTER("否（其他职位）",10011002),NO_MANAGER("否（经理职位）",10011003);
        private String typeName;
        private int status;
        private PositionType(String typeName, int status){
            this.typeName = typeName;
            this.status = status;
        }

        public String getTypeName() {
            return typeName;
        }

        public void setTypeName(String typeName) {
            this.typeName = typeName;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public static String getTypeName(int status) {
            for(PositionType yesOrNo : PositionType.values()){
                if(yesOrNo.getStatus() == status){
                    return yesOrNo.typeName ;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (PositionType carStatusType : PositionType.values()) {
                Map map = new HashMap();
                map.put("key", carStatusType.getStatus());
                map.put("value", carStatusType.getTypeName());
                list.add(map);
            }
            return list;
        }
    }


    public static enum ProjectSource {
        INPUT(1,"录入"),TRANS(2,"对接"),APP(3,"App");
        private String typeName;
        private int status;
        private ProjectSource(int status, String typeName){
            this.typeName = typeName;
            this.status = status;
        }

        public String getTypeName() {
            return typeName;
        }

        public void setTypeName(String typeName) {
            this.typeName = typeName;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public static String getTypeName(int status) {
            for(ProjectSource item : ProjectSource.values()){
                if(item.getStatus() == status){
                    return item.typeName ;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (ProjectSource carStatusType : ProjectSource.values()) {
                Map map = new HashMap();
                map.put("key", carStatusType.getStatus());
                map.put("value", carStatusType.getTypeName());
                list.add(map);
            }
            return list;
        }
    }

    public static enum TcbYesOrNo {
        YES("是",10011001),NO("否",10011002);
        private String typeName;
        private int status;
        private TcbYesOrNo(String typeName, int status){
            this.typeName = typeName;
            this.status = status;
        }

        public String getTypeName() {
            return typeName;
        }

        public void setTypeName(String typeName) {
            this.typeName = typeName;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public static String getTypeName(int status) {
            for(TcbYesOrNo tcbYesOrNo : TcbYesOrNo.values()){
                if(tcbYesOrNo.getStatus() == status){
                    return tcbYesOrNo.typeName ;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (TcbYesOrNo carStatusType : TcbYesOrNo.values()) {
                Map map = new HashMap();
                map.put("key", carStatusType.getStatus());
                map.put("value", carStatusType.getTypeName());
                list.add(map);
            }
            return list;
        }
    }


    public static enum YesNo {
        YES("是",1),NO("否",0);
        private String typeName;
        private int status;
        private YesNo(String typeName, int status){
            this.typeName = typeName;
            this.status = status;
        }

        public String getTypeName() {
            return typeName;
        }

        public void setTypeName(String typeName) {
            this.typeName = typeName;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public static String getTypeName(int status) {
            for(YesNo yesNo : YesNo.values()){
                if(yesNo.getStatus() == status){
                    return yesNo.typeName ;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (YesNo carStatusType : YesNo.values()) {
                Map map = new HashMap();
                map.put("key", carStatusType.getStatus());
                map.put("value", carStatusType.getTypeName());
                list.add(map);
            }
            return list;
        }
    }

    public static enum AttenceStatus {
        NORMAL(50011001,"正常"),BENG(50011003,"迟到"),TA(50011004,"早退"),CDZT(50011005,"迟到早退"),LEAVE(1000,"请假"),BLANK(0,"休息");

        private Integer value;
        private String desc;

        private AttenceStatus(Integer value, String desc){
            this.value = value;
            this.desc = desc;
        }

        public Integer getValue() {
            return this.value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDesc(Integer value) {
            for(AttenceStatus userType : AttenceStatus.values()){
                if(userType.getValue().intValue() == value.longValue()){
                    return userType.getDesc() ;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (AttenceStatus carStatusType : AttenceStatus.values()) {
                Map map = new HashMap();
                map.put("key", carStatusType.getValue());
                map.put("value", carStatusType.getDesc());
                list.add(map);
            }
            return list;
        }
    }

    public static enum ApplyType {
        PASS(60011001,"通过"),UNPASS(60011002,"不通过"),WAIT(60011003,"待批");

        private Integer value;
        private String desc;

        private ApplyType(Integer value, String desc){
            this.value = value;
            this.desc = desc;
        }

        public Integer getValue() {
            return this.value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDesc(Integer value) {
            for(ApplyType userType : ApplyType.values()){
                if(userType.getValue().intValue() == value.intValue()){
                    return userType.getDesc() ;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (ApplyType type : ApplyType.values()) {
                Map map = new HashMap();
                map.put("key", type.getValue());
                map.put("value", type.getDesc());
                list.add(map);
            }
            return list;
        }
    }

    public static enum CheckType {
        UNCHECK(0,"未审定"),CHECK(1,"已审定");

        private Integer value;
        private String desc;

        private CheckType(Integer value, String desc){
            this.value = value;
            this.desc = desc;
        }

        public Integer getValue() {
            return this.value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDesc(Integer value) {
            for(CheckType userType : CheckType.values()){
                if(userType.getValue().intValue() == value.intValue()){
                    return userType.getDesc() ;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (CheckType type : CheckType.values()) {
                Map map = new HashMap();
                map.put("key", type.getValue());
                map.put("value", type.getDesc());
                list.add(map);
            }
            return list;
        }
    }

    public static enum IsPublish {
        UNCHECK(10011002,"未发布"),CHECK(10011001,"已发布");

        private Integer value;
        private String desc;

        private IsPublish(Integer value, String desc){
            this.value = value;
            this.desc = desc;
        }

        public Integer getValue() {
            return this.value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDesc(Integer value) {
            for(IsPublish userType : IsPublish.values()){
                if(userType.getValue().intValue() == value.intValue()){
                    return userType.getDesc() ;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (IsPublish type : IsPublish.values()) {
                Map map = new HashMap();
                map.put("key", type.getValue());
                map.put("value", type.getDesc());
                list.add(map);
            }
            return list;
        }
    }

    public static enum IsConfirm {
        UNCHECK(10011002,"未确认"),CHECK(10011001,"已确认");

        private Integer value;
        private String desc;

        private IsConfirm(Integer value, String desc){
            this.value = value;
            this.desc = desc;
        }

        public Integer getValue() {
            return this.value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDesc(Integer value) {
            for(IsConfirm userType : IsConfirm.values()){
                if(userType.getValue().intValue() == value.intValue()){
                    return userType.getDesc() ;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (IsConfirm type : IsConfirm.values()) {
                Map map = new HashMap();
                map.put("key", type.getValue());
                map.put("value", type.getDesc());
                list.add(map);
            }
            return list;
        }
    }
    public static enum ApplyStatus {
        LOCAL(0,"未审核"),OTHER(1,"已审核");

        private Integer value;
        private String desc;

        private ApplyStatus(Integer value, String desc){
            this.value = value;
            this.desc = desc;
        }

        public Integer getValue() {
            return this.value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDesc(Integer value) {
            for(ApplyStatus userType : ApplyStatus.values()){
                if(userType.getValue().intValue() == value.intValue()){
                    return userType.getDesc() ;
                }
            }
            return null;
        }

        public static List getList() {
            List<Map> list = new ArrayList<Map>();
            for (ApplyStatus type : ApplyStatus.values()) {
                Map map = new HashMap();
                map.put("key", type.getValue());
                map.put("value", type.getDesc());
                list.add(map);
            }
            return list;
        }
    }

}
